package com.qaml.mes.device.api;

import com.alibaba.fastjson.JSONObject;
import com.qaml.mes.device.config.FeignClientEncoder;
import com.qaml.mes.device.constant.GlobalConstant;
import com.qaml.mes.device.dto.data.SysUser;
import com.qaml.mes.device.dto.data.SysUserDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName SysUserClient
 * @Description 查询用户信息
 * @Author leikai
 * @Date 2023/10/27 16:01
 * @Version 1.0
 */
@Component
@FeignClient(value = "jeecg-system",configuration = { FeignClientEncoder.class})
public interface SysUserClient {

    /**
     * 获取用户列表数据
     *
     * @param user
     * @param pageNo
     * @param pageSize
     * @return
     */
    @RequestMapping(value = "/sys/user/list", method = RequestMethod.GET)
    JSONObject queryPageList(@RequestHeader(name = GlobalConstant.ACCESS_TOKEN) String accessToken, SysUser user,
                             @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                             @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize);

    /**
     * @功能：根据id 批量查询
     * @param userIds
     * @return
     */
    @RequestMapping(value = "/sys/user/queryByIds", method = RequestMethod.GET)
    JSONObject queryByIds(@RequestHeader(name = GlobalConstant.ACCESS_TOKEN) String accessToken, @RequestParam String userIds);

    /**
     * 根据真实姓名和用户id批量查询用户信息
     * @param sysUserDTO
     * @return
     */
    @RequestMapping(value = "/sys/user/queryByRealNames", method = RequestMethod.POST)
    JSONObject queryByRealNames(@RequestHeader(name = GlobalConstant.ACCESS_TOKEN) String accessToken, @RequestBody SysUserDTO sysUserDTO);

}